import React, { useState } from 'react';
import { AppstoreOutlined, TaobaoOutlined, SettingOutlined } from '@ant-design/icons';
import { Menu } from 'antd';
const items = [
    {
        label: '课程',
        key: 'lesson',
        icon: <TaobaoOutlined />,
        children: [
            {
                label: '编程',
                key: 'coding',
            },
            {
                label: '数学',
                key: 'math',
            },
            {
                label: '英语',
                key: 'english',
            },

        ]
    },
    {
        label: '教师',
        key: 'teacher',
        icon: <SettingOutlined />,
    },
    {
        label: '学生',
        key: 'student',
        icon: <TaobaoOutlined />,
    },
    {
        label: '资源',
        key: 'source',
        icon: <AppstoreOutlined />,
    },

];
const MyMenu = () => {
    const [current, setCurrent] = useState('mail');
    const onClick = e => {
        console.log('click ', e);
        setCurrent(e.key);
    };
    return <Menu style={{ width: '300px' }} onClick={onClick} selectedKeys={[current]} mode="vertical" items={items} />;
};
export default MyMenu;